﻿using System;
using System.Linq.Expressions;
using System.Web.Mvc;
using BoneSystem.Extensions;
using BoneSystem.Extensions.Annotations;
using BoneSystem.Extensions.Annotations.InputTypeAnnotations;
using DevExpress.Web.Mvc;
using DevExpress.XtraPrinting.Native;


namespace Bonesystem.Extensions
{
    public static class InputExtensions
    {

        public static void TextBoxFor<T, TProperty>(this HtmlHelper<T> htmlHelper,
            Expression<Func<T, TProperty>> expression, MVCxFormLayoutItem settings)
        {
            var inputAttribute = ControlHelper.GetAnnotations(htmlHelper, expression);
            if (settings.NestedExtensionSettings is TextBoxSettings)
            {
                TextBoxFor(htmlHelper, expression, (TextBoxSettings)settings.NestedExtensionSettings);
            }

            if (settings.NestedExtensionSettings is ComboBoxSettings)
            {
                ComboBoxBoxFor(htmlHelper, inputAttribute, (ComboBoxSettings)settings.NestedExtensionSettings);
            }
        }

        public static void TextBoxFor<T, TProperty>(this HtmlHelper<T> htmlHelper,
            Expression<Func<T, TProperty>> expression, TextBoxSettings textBoxSettings)
        {
            TextBoxFor(htmlHelper, ControlHelper.GetAnnotations(htmlHelper, expression),  textBoxSettings);
            
        }
        public static void TextBoxFor<T>(this HtmlHelper<T> htmlHelper,
            InputAttribute inputAttribute, TextBoxSettings textBoxSettings)
        {
            TextBoxFor(inputAttribute,textBoxSettings);
        }
        public static void TextBoxFor(InputAttribute inputAttribute, TextBoxSettings textBoxSettings)
        {
            if (inputAttribute is CheckBoxAttribute)
            {

            }
            if (inputAttribute is DateAttribute)
            {

            }
            if (inputAttribute is DateTimeAttribute)
            {

            }
            if (inputAttribute is EMailAttribute)
            {

            }
            if (inputAttribute is IntegerAttribute)
            {

            }
            if (inputAttribute is MonetaryAttribute)
            {

            }
            if (inputAttribute is TimeAttribute)
            {

            }
            if (inputAttribute is UrlAttribute)
            {

            }
        }

       


        private static void ComboBoxBoxFor<T,TProperty>(HtmlHelper<T> htmlHelper, Expression<Func<T, TProperty>> expression, ComboBoxSettings nestedExtensionSettings)
        {
            throw new NotImplementedException();
        }
        private static void ComboBoxBoxFor<T>(HtmlHelper<T> htmlHelper,InputAttribute inputAttribute, ComboBoxSettings nestedExtensionSettings)
        {
            throw new NotImplementedException();
        }
    }
}